<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@page contentType="text/xml"%>
<%@page pageEncoding="UTF-8"%>
<%
        response.setHeader("Cache-Control", "no-cache"); //HTTP 1.1
        response.setHeader("Pragma", "no-cache"); //HTTP 1.0
        response.setDateHeader("Expires", 0); //prevent caching at the proxy server
%>
<sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
   select * from TipoAfastamento
</sql:query>

<rows>
    <c:choose>
        <c:when test="${empty param.page}">
            <page>1</page>
        </c:when>
        <c:otherwise>
            <page>${param.page}</page>
        </c:otherwise>
    </c:choose>
    <total><fmt:formatNumber value="${query.rowCount/10}" pattern="######"/></total>
    <records>${query.rowCount} </records>
    <c:forEach var="row" items="${query.rows}">
        <row id ="${row.id_tipoafastamento}">
            <cell><![CDATA[${fn:trim(row.desc_tipoafastamento)}]]></cell>
        </row>
    </c:forEach>
</rows>